Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add task solution #1536

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

pasha28091997
Copy link

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like there are a few critical issues related to formatting numbers with a thousands separator, which is a core requirement of the task. Please address these formatting issues to ensure the numbers are displayed correctly. Keep up the great work, and I'm sure you'll nail it! 😊

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review button in the Reviewers tab.

allPopulationNumber += +key.innerHTML.replaceAll(',', '');
}

const averagePopulation = allPopulationNumber / element.length;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calculated averagePopulation should be formatted with a thousands separator to match the numeric style of the populations presented, as required by the task description.


const classTotalPopulation = document.querySelector('.total-population');

classTotalPopulation.innerHTML = allPopulationNumber;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The total population number should be formatted with a thousands separator before being assigned to the innerHTML of classTotalPopulation, as required by the task description.


const classAveragePopulation = document.querySelector('.average-population');

classAveragePopulation.innerHTML = averagePopulation;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The average population number should be formatted with a thousands separator before being assigned to the innerHTML of classAveragePopulation, as required by the task description.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on implementing the solution! 🎉 Your code successfully retrieves population data, calculates the total and average, and updates the DOM as required. However, there's a minor issue with the variable formattedallPopulationNumber where it's incorrectly assigned the formatted average population instead of the total population. Make sure to format allPopulationNumber instead of averagePopulation. This decision to approve is to help you move forward with your learning. Please review the comments to improve your code. Keep up the good work and continue learning from these experiences!

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨


const classTotalPopulation = document.querySelector('.total-population');

const formattedallPopulationNumber = averagePopulation.toLocaleString('uk-UA');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable formattedallPopulationNumber is incorrectly assigned the formatted average population instead of the total population. It should format allPopulationNumber instead of averagePopulation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants